'use strict';

module.exports = hexo => {

  const injector = require('hexo-extend-injector2')(hexo);

  const livere = {
    name: 'livere',
    options: {},
    value: () => {
      return `
<!-- 来必力City版安装代码 -->
<div id="lv-container" data-id="city" data-uid="${livere.options.uid}">
<script type="text/javascript">
   (function(d, s) {
       var j, e = d.getElementsByTagName(s)[0];

       if (typeof LivereTower === 'function') { return; }

       j = d.createElement(s);
       j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
       j.async = true;

       e.parentNode.insertBefore(j, e);
   })(document, 'script');
</script>
<noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
</div>
<!-- City版安装代码已完成 -->
      `;
    }
  };

  injector.register('comment', livere);
};
